// pages/knowledge/classify/classifylist.js
var t = getApp(), e = t.requirejs("core"), a = t.requirejs("jquery"), s = t.requirejs("biz/diyform"), i = t.requirejs("biz/goodspicker");

t.requirejs("foxui");
Page({
  /**
   * 页面的初始数据
   */
  data: {
    index:-1,
    id:-1
  },
  classifylist(e){
    console.log(e)
    var id = e.currentTarget.dataset.id
    var that =this;
    that.setData({
      id: id
    }),that.getList(id);
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var s = this;
    e.fromsearch;
    var id = options.id;
    s.setData({
      id:id
    }), this.initCategory()

  },
  initCategory: function () {
    var t = this;
     console.log(t,888);
    e.get("goods/get_categoryknow", {}, function (e) {
 
      t.setData({
        allcategory: e.allcategory,
       
      });
    }),
    console.log(t.data.id,3434)
    t.getList(t.data.id);
  },
  getList:function(option)
  {
    var that = this;
    var cateid= option;
    e.get("goods/get_listknow", {cateid:cateid}, function (e) {
      that.setData({
        allgoods:e.list.list,

      });
    })
  },
 
})